package com.example.file_study.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * description: 返回模型
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private int code;
    private String msg;
    private T data;

    public static <T>Result<T> success(T data) {
        return new Result(200,  "success", data);
    }

    public static <T>Result<T>  fail(String msg) {
        return new Result(500, msg, null);
    }


}